<%@ tag language="java" pageEncoding="UTF-8"%>

<%@ attribute name="name" rtexprvalue="true" required="true"%>
<%@ attribute name="label" rtexprvalue="true"%>
<%@ attribute name="required" rtexprvalue="true"%>
<%@ attribute name="value" rtexprvalue="true"%>
<%@ attribute name="single" rtexprvalue="true"%>
<%@ attribute name="help" rtexprvalue="true"%>
<%@ attribute name="onchange" rtexprvalue="true"%>
<%@ attribute name="onclick" rtexprvalue="true"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="base" uri="/WEB-INF/mytags.tld"%>

<c:set var="local" value="${pageContext.request.contextPath}/service/channelAction" scope="request"/>
<script type="text/javascript" src="${local}/resource/js/jquery.colorpicker.js"></script>
<script type="text/javascript">
$(document).ready(function() {
        $("#${name}").colorpicker({
            fillcolor:true,
            success:function(o,color){
                $(o).css("color",color);
            }
        });
    });
    
    function boldClick(v){
    	$("#bold").val(v);
    	$("#bold").change();
    }
</script>

<c:if test="${required==null}">
	<c:set var="required" value="false" />
</c:if>

<c:choose>
	<c:when test="${single==null}">
		<c:set var="single" value="1" />
	</c:when>
	<c:when test="${single==1}">
		<c:set var="single" value="3" />
	</c:when>
	<c:otherwise>
		<c:set var="single" value="1" />
	</c:otherwise>
</c:choose>

<th><c:if test="${required}">
	<label class="requireField">*</label>
</c:if> <label>${label}:</label></th>

<base:bridge var="map" value="${value}"/>

<td colspan="${single}">
	<input type="text" id="${name}" name="${name}" size="6" value="${base:getMapValue(map,name)}"
		<c:if test="${onchange!=null}"> onchange="${onchange}"</c:if> 
		<c:if test="${onclick!=null}"> onclick="${onclick}"</c:if>/>
		&nbsp; 
	<label>
		<input type="checkbox" onclick="boldClick(this.checked)" <c:if test="${base:getMapValue(map,'bold')}">checked="checked"</c:if>>加粗
		<input type="hidden" name="bold" id="bold" <c:if test="${onchange!=null}"> onchange="${onchange}"</c:if>>
	</label>
	${help}
</td>
